#include<stdio.h>
int N,a,b,c,maxa,maxb,maxc;
char name[9];

int main(int argc, char const *argv[])
{
    int max=0,i;
    char n[9];
    scanf("%d",&N);
    scanf("%s %d %d %d",&name,&maxa,&maxb,&maxc);
    max = maxa+maxb+maxc;
    N--;
    while (N--)
    {
        scanf("%s %d %d %d",&n,&a,&b,&c);
        if (max<a+b+c)
        {
            max = a+b+c;
            maxa = a; 
            maxb = b;
            maxc = c;
            for (i=0; i<9 ; i++)
            {
                if(n[i]) name[i] = n[i];
                else {
                    name[i]='\0';
                    break;
                }
            }
        }
    }
    printf("%s %d %d %d",name,maxa,maxb,maxc);
    return 0;
}
